﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace TM.Data.Contracts
{
    public interface IRepository<T> where T: class
    {
        IQueryable<T> GetAll();
        DataTable GetAllAsDataTable();
        
        T GetById(Guid id);
        DataTable GetByIdAsDataTable(Guid id);

        IQueryable<T> GetList(Func<T, bool> predicate);
        T GetSingle(Func<T, bool> predicate);
        T GetFisrt(Func<T, bool> predicate);

        bool Insert(T entity);
        bool Insert(IList<T> entities);

        bool Update(T entity);
        bool Update(IList<T> entities);

        bool Delete(T entity);
        bool Delete(IList<T> entities);
        bool Delete(Guid id);
        bool Delete(Func<T,bool> predicate );
    }
}
